
import { apiPrefix } from '@/consts/consts'

export default ({ $service:request }) => ({
  // 4.16.1. 频道列表
  channelList(params) {
    return request({
      url: `${apiPrefix}/api/v1/channel/list`,
      method: 'get',
      params
    })
  },

  // 4.16.2. 频道新增
  channelAdd(data) {
    return request({
      url: `${apiPrefix}/api/v1/channel/add`,
      method: 'post',
      data
    })
  },
  
  // 4.16.3. 频道修改
  channelUpdate(data, id) {
    return request({
      url: `${apiPrefix}/api/v1/channel/update/${id}`,
      method: 'put',
      data
    })
  },
    
  // 4.16.4. 频道删除
  channelDelete(id) {
    return request({
      url: `${apiPrefix}/api/v1/channel/delete/${id}`,
      method: 'delete',
    })
  },
    
  // 4.16.5. 修改频道内容
  channelUpdateContent(data, id) {
    return request({
      url: `${apiPrefix}/api/v1/channel/update/content/${id}`,
      method: 'put',
      data
    })
  }
})
